#README: this version will only deal with threads that lz post has pic
#works via hime.appspot,for advanced version that grabs last pic,see new.sh file

wget -O board.htm "http://www.newsmth.net/bbsdoc.php?board=picture&ftype=6"
postnum=`cat board.htm |grep " @" | tail -1 | sed -e "s/c\.o(//g" | sed -e "s/,.*);//g" ; `
                                                                                                   
httpprefix="http://hime.appspot.com/subject/picture/"                                              
posthttp=$httpprefix$postnum                         
#echo $postnum               
#echo $posthttp
              
wget -O post.htm $posthttp
pichttp=`cat post.htm |grep "att\.newsmth" | tail -1 | sed -e "s/.*http:\/\/att\.newsmth\.net\/att\.php/http:\/\/att\.newsmth\.net\/att\.php/g" | sed -e "s/' target='_blank'.*//g" ;`
#echo $pichttp                                                                                                                                                    
             
wget -O latestpic $pichttp
rm -f pic_latest-*.jpg
convert -resize 640x480 latestpic pic_latest.jpg
rm -f latestpic                                     

